package com.clkj.mobileinspector;

import android.app.Application;
import android.content.Context;

import com.baidu.mapapi.CoordType;
import com.baidu.mapapi.SDKInitializer;
import com.clkj.mobileinspector.utils.MyCrashHandler;
import com.lws.basic.utils.common.MyLogger;
import com.lws.basic.utils.common.MyToast;

import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;


/**
 * @松 on 2019/7/18 16:29
 */
public class MyApp extends Application {

    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        MyToast.context = context;
        MyCrashHandler.newInstance().init(this);

        RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
            @Override
            public void accept(Throwable throwable) {
                MyLogger.i("Rx异常处理 " + throwable.getMessage());
            }
        });
        try {
            SDKInitializer.initialize(this);

        } catch (Exception e) {
            MyLogger.i(e.getMessage());
        }

    }

    public static Context getContext() {
        return context;
    }


}
